﻿using System;
using System.Windows.Threading;
using MadMediaManager.WPFSupport.Interfaces.Services.Threading;

namespace MadMediaManager.WPFSupport.Services.Threading
{
    public class DispatcherHooksWrapper : IDispatcherHooks
    {
        private readonly DispatcherHooks _hooks;

        public DispatcherHooksWrapper(DispatcherHooks hooks)
        {
            _hooks = hooks;
        }

        public event EventHandler DispatcherInactive
        {
            add { _hooks.DispatcherInactive += value; }
            remove { _hooks.DispatcherInactive -= value; }
        }

        public event DispatcherHookEventHandler OperationPosted
        {
            add { _hooks.OperationPosted += value; }
            remove { _hooks.OperationPosted -= value; }
        }

        public event DispatcherHookEventHandler OperationCompleted
        {
            add { _hooks.OperationCompleted += value; }
            remove { _hooks.OperationCompleted -= value; }
        }

        public event DispatcherHookEventHandler OperationPriorityChanged
        {
            add { _hooks.OperationPriorityChanged += value; }
            remove { _hooks.OperationPriorityChanged -= value; }
        }

        public event DispatcherHookEventHandler OperationAborted
        {
            add { _hooks.OperationAborted += value; }
            remove { _hooks.OperationAborted -= value; }
        }
    }
}
